package cn.iocoder.yudao.module.promotion.dal.mysql.quickcombinationactivity;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationProductDO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.quickcombinationactivity.QuickCombinationActivityDO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.quickcombinationactivity.QuickCombinationProductDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.promotion.controller.admin.quickcombinationactivity.vo.*;

/**
 * 进货活动 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface QuickCombinationActivityMapper extends BaseMapperX<QuickCombinationActivityDO> {

    default PageResult<QuickCombinationActivityDO> selectPage(QuickCombinationActivityPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QuickCombinationActivityDO>()
                .gtIfPresent(QuickCombinationActivityDO::getEndTime, reqVO.getEndTime())
                .eq(QuickCombinationActivityDO::getDeleted, false)
                .orderByDesc(QuickCombinationActivityDO::getId));
    }

    default List<QuickCombinationActivityDO> selectList(QuickCombinationActivityExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<QuickCombinationActivityDO>()
                .likeIfPresent(QuickCombinationActivityDO::getName, reqVO.getName())
                .betweenIfPresent(QuickCombinationActivityDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(QuickCombinationActivityDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(QuickCombinationActivityDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(QuickCombinationActivityDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QuickCombinationActivityDO::getId));
    }
}
